<div class="row white-bg dashboard-header">
    <div class="col-sm-3">
        <div class="input-group" style="width: 100%;">
            <input type="text" class="form-control" placeholder="搜索内容" v-model="search_value" name="search_value" autocomplete="off">
            <!--<span class="input-group-btn">
                    <button class="btn btn-default" type="button" @click="window.get_cust_sale();" title="回车也可搜索">
                        查找
                    </button>
            </span>-->
        </div>
    </div>
    <div class="col-sm-9">
        <button type="button" class="btn btn-danger" @click="openModal(1)" data-toggle="modal" data-target="#myModal">批量清除数据</button>
        <!--<button type="button" class="btn btn-danger" @click="clearAll">{{ word ? '清除 '+word+' 的所有经营权限' : '清除所有数据' }}</button>-->
        <button type="button" class="btn btn-primary" @click="downloadModel">模板下载</button>
        <button type="button" class="btn btn-primary" @click="openModal(2)" data-toggle="modal" data-target="#myModal">导出数据</button>
        <button type="button" class="btn btn-primary" @click="openTrigger">导入数据</button>
        <form style="display:none;" enctype="multipart/form-data" method="post" id="excel" target="frameName" action="/brand/goods/importCustSaleList.html">
            <input type="file" id="excel-input" name="file1" @change="importList">
        </form>
        <iframe id="target" style="display: none;" src="" frameborder="0" name="frameName"></iframe>
    </div>
    <div class="col-sm-12" style="padding-top: 13px;color:#bfc2c3;font-size: 12px;">
        *1.搜索支持方式：经销商编码 / @经营编码 / @经营类型 / 经销商编码@经营编码 / 经销商编码@经营类型。<br>
        &nbsp;&nbsp;2.导入数据时，文件名需不同于上一份导入文件的文件名。<br>
        &nbsp;&nbsp;3.导入文件格式支持“xls、xlsx、csv”。<br>
        &nbsp;&nbsp;5.导入文件行数不能超过1500。
    </div>
</div>
<div class="row white-bg dashboard-header" style="padding: 0px 20px 20px 20px;">
    <div class="col-sm-12">
        <div class="table-responsive">
            <table class="table">
                <!--<caption>响应式表格布局</caption>-->
                <thead>
                    <tr>
                        <th>#序号</th>
                        <th>经销商编码</th>
                        <th>经营代号</th>
                        <th>经营范围</th>
                        <th>经营编码</th>
                        <th>经营类型</th>
                        <th>追加类型</th>
                        <th>追加类型描述</th>
                        <th>最后同步时间</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    <tr v-for="(info,index) in list">
                        <td>{{ info.ROW_NUMBER }}</td>
                        <td>{{ info.fCCode }}</td>
                        <td>{{ info.fType }}</td>
                        <td>{{ info.fTypeDesc }}</td>
                        <td>{{ info.fKey }}</td>
                        <td>{{ info.fKeyDesc ? info.fKeyDesc : '-'  }}</td>
                        <td>{{ info.fAddedType ? info.fAddedType : '-' }}</td>
                        <td>{{ info.fAddedTypeDesc ? info.fAddedTypeDesc : '-' }}</td>
                        <td>{{ info.sync_datetime }}</td>
                        <td>
                            <button type="button" class="btn btn-danger" @click="deleteCustSale(index)">删除此条经营权限</button>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <p v-if="list==''" style="text-align:center;text-decoration: underline;">暂无数据</p>
        <div v-if="list">
            当前为第&nbsp;{{ page }}&nbsp;页，共&nbsp;{{ totalCount }}&nbsp;条，共&nbsp;{{ totalPage }}&nbsp;页；
        </div>
    </div>
</div>
<div class="page" v-if="totalPage > 1">
    <ul class="pagination">
        <li v-if="page > 1" title="上一页"><a href="javascript:void(0);" v-on:click="toLastPage()">&laquo;</a></li>
        <li v-for="(info,index) in pageList"><a href="javascript:void(0);" v-on:click="toPage(index)">{{ info }}</a></li>
        <li v-if="page != totalPage" title="下一页"><a href="javascript:void(0);" v-on:click="toNextPage()">&raquo;</a></li>
    </ul>
</div>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">{{title}}</h4>
            </div>
            <div class="modal-body">
                <div class="col-sm-12" style="padding-top: 13px;color:#bfc2c3;font-size: 12px;padding-bottom: 13px;">
                    *请在输入框输入筛选条件，如果无筛选条件默认为清除/导出所有数据。
                </div>
                <form class="form-horizontal" role="form">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">经销商编码</label>
                        <div class="col-sm-9">
                            <input type="text" class="form-control" id="firstname" placeholder="请输入经销商编码" v-model="fCCode" autocomplete="off">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">经营编码</label>
                        <div class="col-sm-9">
                            <input type="text" class="form-control"  placeholder="请输入经营编码" v-model="fKey" autocomplete="off">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">经营类型</label>
                        <div class="col-sm-9">
                            <input type="text" class="form-control"  placeholder="请输入经营类型" v-model="fKeyDesc" autocomplete="off">
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-danger" v-if="title=='清除数据'" @click="clearAll">清除数据</button>
                <button type="button" class="btn btn-primary" v-if="title=='导出数据'" @click="downloadList">导出数据</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>
